import React,{Component} from 'react'
import {BrowserRouter,Route,Switch} from 'react-router-dom'
import Login from './pages/login/login'
import Admin from './pages/admin/admin'
import storageUtil from "./utils/storageUtils";
import memoryUtils from "./utils/memoryUtils";
class App extends Component{

  //注意component为小写test
  render(){
      if(storageUtil.getUser()&&storageUtil.getUser().id){
          memoryUtils.user=storageUtil.getUser()
      }


     return (
      <BrowserRouter>
        <Switch>
          <Route path="/login" component={Login}></Route>
          <Route path="/" component={Admin}></Route>
        </Switch>
         
      </BrowserRouter>
    );
  }
}
export default App;